/* Markdown编辑器样式 */
.markdown-editor {
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  position: relative;
}

.markdown-editor.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  border: none;
  border-radius: 0;
}

/* 工具栏样式 */
.editor-toolbar {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #e1e5e9;
  flex-wrap: wrap;
  gap: 4px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.toolbar-group button {
  padding: 6px 10px;
  border: 1px solid #d1d5da;
  background: #fff;
  color: #24292e;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  min-width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-group button:hover {
  background: #f6f8fa;
  border-color: #c1c8cd;
}

.toolbar-group button:active {
  background: #e1e5e9;
}

.toolbar-group button.active {
  background: #0366d6;
  color: #fff;
  border-color: #0366d6;
}

.toolbar-right {
  margin-left: auto;
}

/* 编辑器内容区域 */
.editor-content {
  display: flex;
  position: relative;
}

.editor-panel {
  flex: 1;
  position: relative;
}

.editor-textarea {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  padding: 16px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #24292e;
  background: #fff;
  resize: none;
  box-sizing: border-box;
}

.editor-textarea::placeholder {
  color: #6a737d;
}

.preview-panel {
  flex: 1;
  overflow-y: auto;
  background: #fff;
}

/* 全屏模式 */
.fullscreen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-content {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  height: 90%;
  max-width: 1200px;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.fullscreen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e1e5e9;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

.fullscreen-header h3 {
  margin: 0;
  font-size: 18px;
  color: #24292e;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #6a737d;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.close-btn:hover {
  background: #e1e5e9;
  color: #24292e;
}

.fullscreen-body {
  flex: 1;
  overflow: hidden;
  display: flex;
}

.fullscreen-textarea {
  height: 100%;
  font-size: 16px;
  padding: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .editor-toolbar {
    padding: 6px 8px;
    gap: 2px;
  }
  
  .toolbar-group button {
    padding: 4px 6px;
    font-size: 11px;
    min-width: 28px;
    height: 24px;
  }
  
  .editor-textarea {
    padding: 12px;
    font-size: 13px;
  }
  
  .fullscreen-content {
    width: 95%;
    height: 95%;
  }
  
  .fullscreen-header {
    padding: 12px 16px;
  }
  
  .fullscreen-textarea {
    padding: 16px;
    font-size: 14px;
  }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
  .markdown-editor {
    background: #1a1a1a;
    border-color: #404040;
  }
  
  .editor-toolbar {
    background: #2d2d2d;
    border-bottom-color: #404040;
  }
  
  .toolbar-group button {
    background: #2d2d2d;
    color: #e0e0e0;
    border-color: #404040;
  }
  
  .toolbar-group button:hover {
    background: #404040;
    border-color: #555;
  }
  
  .toolbar-group button:active {
    background: #555;
  }
  
  .toolbar-group button.active {
    background: #0366d6;
    color: #fff;
    border-color: #0366d6;
  }
  
  .editor-textarea {
    background: #1a1a1a;
    color: #e0e0e0;
  }
  
  .editor-textarea::placeholder {
    color: #888;
  }
  
  .preview-panel {
    background: #1a1a1a;
  }
  
  .fullscreen-content {
    background: #1a1a1a;
  }
  
  .fullscreen-header {
    background: #2d2d2d;
    border-bottom-color: #404040;
  }
  
  .fullscreen-header h3 {
    color: #e0e0e0;
  }
  
  .close-btn {
    color: #888;
  }
  
  .close-btn:hover {
    background: #404040;
    color: #e0e0e0;
  }
}

/* 动画效果 */
.markdown-editor {
  transition: all 0.3s ease;
}

.toolbar-group button {
  transition: all 0.15s ease;
}

.fullscreen-overlay {
  animation: fadeIn 0.3s ease;
}

.fullscreen-content {
  animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
